package Controllers;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonBar;
import javafx.scene.control.ButtonType;

public class LoginController {
    @FXML
    private Button login_button;//和fxml中配置的fx:id一样
    //alert 弹框
    public void alert(ActionEvent event) {//在fxml里配置onAction="#alert"
        String info="Hello!";
        Alert alert = new Alert(Alert.AlertType.INFORMATION, info, new ButtonType("确定", ButtonBar.ButtonData.YES));
        alert.setHeaderText(null);
        alert.setTitle("提示");
        alert.show();
    }
}
